package com.aktk.battlenole;

import com.aktk.battlenole.GameData.Stages;
import com.aktk.gameelements.Player;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;

public class PlayerSelectActivity extends Activity {
	ImageButton bOneDevice;
	ImageButton bTwoDevice;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_player_select);
        
        bOneDevice = (ImageButton) findViewById(R.id.button1Device);
        bOneDevice.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				GameData game = new GameData();
		        game.stage = Stages.MAIN_PAGE;
		        game.numDevices = 1;
		        Player player1 = game.getPlayer(1);
		        player1 = null;
		        Player player2 = game.getPlayer(2);
		        player2 = null;	
				
				Intent i = new Intent(PlayerSelectActivity.this, SwitchActivity.class);
                startActivity (i);
			}
		});
        
        bTwoDevice = (ImageButton) findViewById(R.id.button2Device);
        bTwoDevice.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				GameData game = new GameData();
		        game.numDevices = 2;
		        game.stage = Stages.GAME;
		        Player player1 = game.getPlayer(1);
		        player1 = null;
		        Player player2 = game.getPlayer(2);
		        player2 = null;	
		        //game.startGame();
		        Intent i = new Intent(PlayerSelectActivity.this, MultiDeviceActivity.class);
				//Intent i = new Intent(PlayerSelectActivity.this, MultiGameActivity.class);
                startActivity (i);
			}
		});
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
}
